<?php

namespace app\backend\validate;

use think\Validate;

class CateValidate extends Validate
{
    protected $rule = [
        'page' => 'integer',
        'limit' => 'integer',
        'id' => 'require|integer',
        'cate_name' => 'require',
    ];

    protected $message = [
        'page.integer' => '页码格式错误',
        'limit.integer' => '条数格式错误',
        'id.require' => 'ID不能为空',
        'id.integer' => 'ID格式错误',
        'cate_name.require' => '分类名称不能为空',
    ];

    protected $scene = [
        'index' => ['page','limit'],
        'add' => ['cate_name'],
        'edit' => ['id','cate_name'],
        'del' => ['id']
    ];
}
